package com.javasm.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @version 0.1
 * @className: PageInfo
 * @description:
 * @author: gfs
 * @date: 2025/6/20 11:21
 * @since: jdk17
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class PageInfo {

    private Integer page;
    private Integer pageSize;
    private Integer total;


    public static Integer getTotalPage(Integer total,Integer pageSize){
        //  total%pageSize
        //如果余数为0   total/pageSize
        //如果余数不为0 total/pageSize +1
        Integer totalPage = total%pageSize==0?total/pageSize:total/pageSize +1;
        return totalPage;
    }

}
